package com.config;

import com.entity.Student;
import com.processor.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

@Configuration
public class MainConfig {

    Logger logger = LoggerFactory.getLogger(getClass());


    @Bean(initMethod = "studentInitMetohd",destroyMethod = "studentDestroyMetohd")
    public Student student(){
        Student student = new Student();
        student.setName("Baohuajie");
        student.setAge(27);
        return student;
    }



    @Bean
    public CustomBeanPostProcessor customBeanPostProcessor(){
        return new CustomBeanPostProcessor();
    }

    @Bean
    public CustomBeanFactoryPostProcessor customBeanFactoryPostProcessor(){
        return new CustomBeanFactoryPostProcessor();
    }
    @Bean
    public CustomInstatiationAwareBeanPostProcessor customInstatiationAwareBeanPostProcessor(){
        return new CustomInstatiationAwareBeanPostProcessor();
    }

}
